﻿using System.Windows.Forms;
using WebMoney.WMSignerFX.KeysExtractor.Properties;

namespace WebMoney.WMSignerFX.KeysExtractor
{
    public partial class PasswordForm : Form
    {
        public string Password
        {
            get
            {
                return passwordTextBox.Text;
            }
        }

        public PasswordForm()
        {
            InitializeComponent();
        }

        private void okButton_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(passwordTextBox.Text))
            {
                MessageBox.Show(this, Resources.WrongPwd, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void passwordTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
                okButton_Click(sender, null);
        }
    }
}